<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 11:50  => 1970
    // 12:00  => 1970

    //  72秒
    // 1分 12秒  

    // 60 * 60 * 24

    //   122 % 60  = 2
    // flag /  (60 * 60) % 24


    function fn(value) {
      var start = +new Date()
      var end = +new Date(value)

      var flag = parseInt((end - start) / 1000)

      var tian = parseInt(flag / 60 / 60 / 24)

      var shi =  parseInt(flag / 60 / 60 % 24)
      
      var fen =  parseInt(flag / 60 % 60)

      var miao = parseInt(flag % 60)

      var str = tian + '天' + shi + '时' + fen + '分' + miao + '秒'

      console.log(str)
    }

    fn('2021-12-9 12:00:00')
  </script>
</body>
</html>